home *** CD-ROM | disk | FTP | other *** search
- stop();
- delete onEnterFrame;
- rdyButt.onRelease = function()
- {
- play();
- immobile = false;
- lKey = 0;
- rKey = 0;
- playerSpeed = 10;
- playerDistance = 0;
- playerSpeedRnd = 0;
- onEnterFrame = function()
- {
- pitchDistance += pitchSpeed / 144;
- playerDistance += playerSpeed / 144;
- pitchSpeed *= 0.9999;
- pitchDistanceRnd = Math.round(pitchDistance) - Math.round(playerDistance);
- if(pitchDistanceRnd <= 5)
- {
- gotoAndStop("end");
- play();
- delete onEnterFrame;
- }
- else if(pitchDistanceRnd <= 30)
- {
- ball._x = Stage.width - (30 - pitchDistanceRnd) * Stage.width / 60 - _X;
- }
- pitchSpeedRnd = Math.round(pitchSpeed);
- if(pitchSpeedRnd <= 0)
- {
- gotoAndStop("fail");
- play();
- delete onEnterFrame;
- }
- playerSpeedRnd = Math.round(playerSpeed);
- if(!immobile)
- {
- switch(rKey)
- {
- case 0:
- if(Key.isDown(39))
- {
- rKey = 1;
- }
- break;
- case 1:
- if(Key.isDown(39))
- {
- rKey = 2;
- }
- else
- {
- rKey = 0;
- }
- break;
- case 2:
- if(!Key.isDown(39))
- {
- rKey = 0;
- }
- }
- switch(lKey)
- {
- case 0:
- if(Key.isDown(37))
- {
- lKey = 1;
- }
- break;
- case 1:
- if(Key.isDown(37))
- {
- lKey = 2;
- }
- else
- {
- lKey = 0;
- }
- break;
- case 2:
- if(!Key.isDown(37))
- {
- lKey = 0;
- }
- }
- switch(runStage)
- {
- case 0:
- if(rKey == 1)
- {
- playerSpeed++;
- runStage = 1;
- }
- else if(lKey == 1)
- {
- playerSpeed++;
- runStage = 2;
- }
- break;
- case 1:
- if(lKey == 1)
- {
- playerSpeed++;
- runStage = 2;
- }
- break;
- case 2:
- if(rKey == 1)
- {
- playerSpeed++;
- runStage = 1;
- }
- }
- }
- };
- };
-